package com.caocaog.market.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 店铺加价配置类型枚举
 *
 * @author chechen
 * @date 2020-10-25
 */
@Getter
@AllArgsConstructor
public enum ShopFareConfigEnum {

    /**
     * 夜间加价
     */
    NIGHTLY_FARE(1),

    /**
     * 特殊天气加价
     */
    WEATHER_FARE(2),

    /**
     * 未找到
     */
    UNDEFINED(0);

    private final Integer type;

    public static ShopFareConfigEnum match(int type) {
        for (ShopFareConfigEnum item : ShopFareConfigEnum.values()) {
            if (item.type == type) {
                return item;
            }
        }
        return UNDEFINED;
    }

}
